package com.pan.concurrency.thread;

import javax.sound.midi.Soundbank;

/**
 * <p>
 *      线程睡眠
 * </p>
 *
 * @author kaiji
 * @since 2020/1/14 16:48
 */
public class SleepThread {

    public static void main(String[] args) {
        MySleepRunner mySleepRunner = new MySleepRunner();
        Thread t = new Thread(mySleepRunner, "子线程");
        t.setPriority(Thread.MAX_PRIORITY);
        t.start();

        System.out.println(Thread.currentThread().getName() + "运行完成！");
    }
}

class MySleepRunner extends Thread {

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(Thread.currentThread().getName() + "运行完成！");
    }
}
